using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._RasterAnalysisTools._UseProximity
{
    /// <summary>
    /// <para>Optimal Path As Raster</para>
    /// <para>Calculates the optimal path from a source to a destination as a raster.</para>
    /// <para>以栅格形式计算从源到目标的最佳路径。</para>
    /// </summary>    
    [DisplayName("Optimal Path As Raster")]
    public class OptimalPathAsRaster : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public OptimalPathAsRaster()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_inputDestinationRasterOrFeatures">
        /// <para>Input raster or feature destination data</para>
        /// <para><xdoc>
        ///   <para>A raster or feature dataset that identifies locations from which the least accumulative cost path is determined to the least costly source.</para>
        ///   <para>For a raster, the input type must be integer, and it must consist of cells that have valid values (zero is a valid value). The remaining cells must be assigned NoData.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>一种栅格或要素数据集，用于标识从中确定累积成本最低路径到成本最低的来源的位置。</para>
        ///   <para>对于栅格，输入类型必须为整数，并且必须由具有有效值（零为有效值）的像元组成。必须为其余单元格分配 NoData。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_inputDistanceAccumulationRaster">
        /// <para>Input distance accumulation raster</para>
        /// <para><xdoc>
        ///   <para>The distance accumulation raster is used to determine the optimal path from the sources to the destinations.</para>
        ///   <para>The distance accumulation raster is usually created with the Distance Accumulation or Distance Allocation tools. Each cell in the distance accumulation raster represents the minimum accumulative cost distance over a surface from each cell to a set of source cells.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>距离累积栅格用于确定从源到目标的最佳路径。</para>
        ///   <para>距离累积栅格通常使用距离累积或距离分配工具创建。距离累积栅格中的每个像元表示从每个像元到一组源像元的表面上的最小累积成本距离。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_inputBackDirectionRaster">
        /// <para>Input back direction or flow direction raster</para>
        /// <para><xdoc>
        ///   <para>The back direction raster contains calculated directions in degrees. The direction identifies the next cell along the optimal path back to the least accumulative cost source while avoiding barriers.</para>
        ///   <para>The range of values is from 0 degrees to 360 degrees. The value 0 is reserved for the source cells. Due east (right) is 90 degrees, and the values increase clockwise (180 is south, 270 is west, and 360 is north).</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>返回方向栅格包含以度为单位的计算方向。该方向沿最佳路径确定下一个单元，返回到累积成本最低的来源，同时避免障碍。</para>
        ///   <para>值的范围是从 0 度到 360 度。值 0 保留给源单元格。正东（右）为 90 度，值顺时针增加（180 为南，270 为西，360 为北）。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_outputRasterName">
        /// <para>Output Raster Name</para>
        /// <para>The name of output raster service that contains the optimal paths.</para>
        /// <para>包含最佳路径的输出栅格服务的名称。</para>
        /// </param>
        public OptimalPathAsRaster(object _inputDestinationRasterOrFeatures, object _inputDistanceAccumulationRaster, object _inputBackDirectionRaster, object _outputRasterName)
        {
            this._inputDestinationRasterOrFeatures = _inputDestinationRasterOrFeatures;
            this._inputDistanceAccumulationRaster = _inputDistanceAccumulationRaster;
            this._inputBackDirectionRaster = _inputBackDirectionRaster;
            this._outputRasterName = _outputRasterName;
        }
        public override string ToolboxName => "Raster Analysis Tools";

        public override string ToolName => "Optimal Path As Raster";

        public override string CallName => "ra.OptimalPathAsRaster";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_inputDestinationRasterOrFeatures, _inputDistanceAccumulationRaster, _inputBackDirectionRaster, _outputRasterName, _destinationField, _pathType.GetGPValue(), _outputRaster];

        /// <summary>
        /// <para>Input raster or feature destination data</para>
        /// <para><xdoc>
        ///   <para>A raster or feature dataset that identifies locations from which the least accumulative cost path is determined to the least costly source.</para>
        ///   <para>For a raster, the input type must be integer, and it must consist of cells that have valid values (zero is a valid value). The remaining cells must be assigned NoData.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>一种栅格或要素数据集，用于标识从中确定累积成本最低路径到成本最低的来源的位置。</para>
        ///   <para>对于栅格，输入类型必须为整数，并且必须由具有有效值（零为有效值）的像元组成。必须为其余单元格分配 NoData。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster or feature destination data")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputDestinationRasterOrFeatures { get; set; }


        /// <summary>
        /// <para>Input distance accumulation raster</para>
        /// <para><xdoc>
        ///   <para>The distance accumulation raster is used to determine the optimal path from the sources to the destinations.</para>
        ///   <para>The distance accumulation raster is usually created with the Distance Accumulation or Distance Allocation tools. Each cell in the distance accumulation raster represents the minimum accumulative cost distance over a surface from each cell to a set of source cells.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>距离累积栅格用于确定从源到目标的最佳路径。</para>
        ///   <para>距离累积栅格通常使用距离累积或距离分配工具创建。距离累积栅格中的每个像元表示从每个像元到一组源像元的表面上的最小累积成本距离。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input distance accumulation raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputDistanceAccumulationRaster { get; set; }


        /// <summary>
        /// <para>Input back direction or flow direction raster</para>
        /// <para><xdoc>
        ///   <para>The back direction raster contains calculated directions in degrees. The direction identifies the next cell along the optimal path back to the least accumulative cost source while avoiding barriers.</para>
        ///   <para>The range of values is from 0 degrees to 360 degrees. The value 0 is reserved for the source cells. Due east (right) is 90 degrees, and the values increase clockwise (180 is south, 270 is west, and 360 is north).</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>返回方向栅格包含以度为单位的计算方向。该方向沿最佳路径确定下一个单元，返回到累积成本最低的来源，同时避免障碍。</para>
        ///   <para>值的范围是从 0 度到 360 度。值 0 保留给源单元格。正东（右）为 90 度，值顺时针增加（180 为南，270 为西，360 为北）。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input back direction or flow direction raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputBackDirectionRaster { get; set; }


        /// <summary>
        /// <para>Output Raster Name</para>
        /// <para>The name of output raster service that contains the optimal paths.</para>
        /// <para>包含最佳路径的输出栅格服务的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Raster Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _outputRasterName { get; set; }


        /// <summary>
        /// <para>Destination field</para>
        /// <para>The field that is used to obtain values for the destination locations.</para>
        /// <para>用于获取目标位置值的字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Destination field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _destinationField { get; set; } = null;


        /// <summary>
        /// <para>Path type</para>
        /// <para><xdoc>
        ///   <para>Specifies a keyword defining the manner in which the values and zones in the input destination data will be interpreted in the cost path calculations.</para>
        ///   <bulletList>
        ///     <bullet_item>Each zone—For each zone in the input destination data, a least-cost path is determined and saved on the output raster. With this option, the least-cost path for each zone begins at the cell with the lowest cost distance weighting in the zone. This is the default.</bullet_item><para/>
        ///     <bullet_item>Best single—For all cells in the input destination data, the least-cost path is derived from the cell with the minimum of the least-cost paths to source cells.</bullet_item><para/>
        ///     <bullet_item>Each cell—For each cell with valid values in the input destination data, a least-cost path is determined and saved on the output raster. With this option, each cell of the input destination data is treated separately, and a least-cost path is determined for each cell.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定一个关键字，用于定义在成本路径计算中解释输入目标数据中的值和区域的方式。</para>
        ///   <bulletList>
        ///     <bullet_item>每个区域 - 对于输入目标数据中的每个区域，将确定成本最低的路径并将其保存在输出栅格上。使用此选项时，每个区域的最低成本路径从区域中成本距离加权最低的像元开始。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>最佳单像元 - 对于输入目标数据中的所有像元，开销最低的路径是从到源像元的开销最低路径的像元派生的。</bullet_item><para/>
        ///     <bullet_item>每个像元 - 对于输入目标数据中具有有效值的每个像元，将确定成本最低的路径并将其保存在输出栅格上。使用此选项，将单独处理输入目标数据的每个单元格，并为每个单元格确定成本最低的路径。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Path type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _pathType_value _pathType { get; set; } = _pathType_value._EACH_ZONE;

        public enum _pathType_value
        {
            /// <summary>
            /// <para>Best single</para>
            /// <para>Best single—For all cells in the input destination data, the least-cost path is derived from the cell with the minimum of the least-cost paths to source cells.</para>
            /// <para>最佳单像元 - 对于输入目标数据中的所有像元，开销最低的路径是从到源像元的开销最低路径的像元派生的。</para>
            /// </summary>
            [Description("Best single")]
            [GPEnumValue("BEST_SINGLE")]
            _BEST_SINGLE,

            /// <summary>
            /// <para>Each cell</para>
            /// <para>Each cell—For each cell with valid values in the input destination data, a least-cost path is determined and saved on the output raster. With this option, each cell of the input destination data is treated separately, and a least-cost path is determined for each cell.</para>
            /// <para>每个像元 - 对于输入目标数据中具有有效值的每个像元，将确定成本最低的路径并将其保存在输出栅格上。使用此选项，将单独处理输入目标数据的每个单元格，并为每个单元格确定成本最低的路径。</para>
            /// </summary>
            [Description("Each cell")]
            [GPEnumValue("EACH_CELL")]
            _EACH_CELL,

            /// <summary>
            /// <para>Each zone</para>
            /// <para>Each zone—For each zone in the input destination data, a least-cost path is determined and saved on the output raster. With this option, the least-cost path for each zone begins at the cell with the lowest cost distance weighting in the zone. This is the default.</para>
            /// <para>每个区域 - 对于输入目标数据中的每个区域，将确定成本最低的路径并将其保存在输出栅格上。使用此选项时，每个区域的最低成本路径从区域中成本距离加权最低的像元开始。这是默认设置。</para>
            /// </summary>
            [Description("Each zone")]
            [GPEnumValue("EACH_ZONE")]
            _EACH_ZONE,

        }

        /// <summary>
        /// <para>Output Raster</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Raster")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _outputRaster { get; set; }


        public OptimalPathAsRaster SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}